package com.yanqu.road.entity.activity.pawnshop;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

/**
 * 玩家的当铺事件数据
 * 
 * @author sjh
 *
 */
@FieldTypeAnnotation(tableName = "t_u_activity_pawnshop_event")
public class UserPawnshopEvent extends DataObject {

	@FieldTypeAnnotation(select = true, update = true, desc = "用户ID")
	private long userId;

	@FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
	private int activityId;

	@FieldTypeAnnotation(update = true, desc = "事件ID=生成时的时间戳")
	private long eventId;

	@FieldTypeAnnotation(desc = "事件类型：1售卖，2购买，3典当，4送钱，5赌石")
	private int type;

	@FieldTypeAnnotation(desc = "npc数据")
	private PawnshopNpc npc;

	@FieldTypeAnnotation(desc = "物件数据")
	private List<PawnshopItem> itemList;

	// 送钱事件数据/////////////////////////////////////////////////////////////
	@FieldTypeAnnotation(desc = "送钱事件数据")
	private PawnshopMoney money;

	// 买卖事件数据/////////////////////////////////////////////////////////////
	@FieldTypeAnnotation(desc = "是否假货事件")
	private boolean isFake;

	@FieldTypeAnnotation(desc = "洗脑次数")
	private int washTime;

	@FieldTypeAnnotation(desc = "玩家的出价")
	private long userBid;
	@FieldTypeAnnotation(desc = "状态")
	private int status;
	@FieldTypeAnnotation(desc = "是否结束")
    private boolean finish;
	@FieldTypeAnnotation(desc = "耐心")
	private int patient;
	@FieldTypeAnnotation(desc = "价格列表")
	private List<PawnshopBidPrice> priceList = new ArrayList<>();
	@FieldTypeAnnotation(desc = "NPC出价")
	private long npcBid;
	@FieldTypeAnnotation(desc = "NPC期望值")
	private long npcWantPrice;
	@FieldTypeAnnotation(desc = "估价")
	private long valuationPrice;
	@FieldTypeAnnotation(desc = "购买最低，出售最高")
	private long maxPrice;

	// ========================================================================
	public long getUserId() {
		return userId;
	}
	public void setUserId(long userId) {
		if (this.userId != userId) {
			this.userId = userId;
			setUpdateOption();
		}
	}

	public int getActivityId() {
		return activityId;
	}
	public void setActivityId(int activityId) {
		if (this.activityId != activityId) {
			this.activityId = activityId;
			setUpdateOption();
		}
	}

	public long getEventId() {
		return eventId;
	}
	public void setEventId(long eventId) {
		if (this.eventId != eventId) {
			this.eventId = eventId;
			setUpdateOption();
		}
	}

	public int getType() {
		return type;
	}
	public void setType(int type) {
		if (this.type != type) {
			this.type = type;
			setUpdateOption();
		}
	}

	public PawnshopNpc getNpc() {
		return npc;
	}
	public void setNpc(PawnshopNpc npc) {
		if (null == npc){
			return;
		}
		if (this.npc == null || !this.npc.equals(npc)) {
			this.npc = npc;
			setUpdateOption();
		}
	}

	public java.util.List<PawnshopItem> getItemList() {
		return itemList;
	}
	public void setItemList(java.util.List<PawnshopItem> itemList) {
		if (null == itemList){
			return;
		}
		if (this.itemList == null || !this.itemList.equals(itemList)) {
			this.itemList = itemList;
			setUpdateOption();
		}
	}

	public PawnshopMoney getMoney() {
		return money;
	}
	public void setMoney(PawnshopMoney money) {
		if (null == money){
			return;
		}
		if (this.money == null || !this.money.equals(money)) {
			this.money = money;
			setUpdateOption();
		}
	}

	public boolean getIsFake() {
		return isFake;
	}
	public void setIsFake(boolean isFake) {
		if (this.isFake != isFake) {
			this.isFake = isFake;
			setUpdateOption();
		}
	}

	public long getUserBid() {
		return userBid;
	}
	public void setUserBid(long userBid) {
		if (this.userBid != userBid) {
			this.userBid = userBid;
			setUpdateOption();
		}
	}


	public int getWashTime() {
		return washTime;
	}

	public void setWashTime(int washTime) {
		if(this.washTime != washTime) {
			this.washTime = washTime;
			setUpdateOption();
		}
	}

    public boolean isFinish() {
        return finish;
    }

    public void setFinish(boolean finish) {
        if (!Objects.equals(this.finish, finish)) {
            this.finish = finish;
            setUpdateOption();
        }
    }

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		if (!Objects.equals(this.status, status)) {
			this.status = status;
			setUpdateOption();
		}
	}

	public boolean isFake() {
		return isFake;
	}

	public void setFake(boolean fake) {
		if (!Objects.equals(this.isFake, fake)) {
			this.isFake = fake;
			setUpdateOption();
		}
	}

	public int getPatient() {
		return patient;
	}

	public void setPatient(int patient) {
		if (patient < 0) {
			patient = 0;
		}
		if (!Objects.equals(this.patient, patient)) {
			this.patient = patient;
			setUpdateOption();
		}
	}

	public List<PawnshopBidPrice> getPriceList() {
		return priceList;
	}

	public void setPriceList(List<PawnshopBidPrice> priceList) {
		if (!Objects.equals(this.priceList, priceList)) {
			this.priceList = priceList;
			setUpdateOption();
		}
	}

	public long getNpcBid() {
		return npcBid;
	}

	public void setNpcBid(long npcBid) {
		if (!Objects.equals(this.npcBid, npcBid)) {
			this.npcBid = npcBid;
			setUpdateOption();
		}
	}

	public long getNpcWantPrice() {
		return npcWantPrice;
	}

	public void setNpcWantPrice(long npcWantPrice) {
		if (!Objects.equals(this.npcWantPrice, npcWantPrice)) {
			this.npcWantPrice = npcWantPrice;
			setUpdateOption();
		}
	}

	public long getValuationPrice() {
		return valuationPrice;
	}

	public void setValuationPrice(long valuationPrice) {
		if (!Objects.equals(this.valuationPrice, valuationPrice)) {
			this.valuationPrice = valuationPrice;
			setUpdateOption();
		}
	}

	public long getMaxPrice() {
		return maxPrice;
	}

	public void setMaxPrice(long maxPrice) {
		if (!Objects.equals(this.maxPrice, maxPrice)) {
			this.maxPrice = maxPrice;
			setUpdateOption();
		}
	}
}
